package com.字节缓冲流;

import lombok.SneakyThrows;

import java.io.BufferedOutputStream;
import java.io.FileOutputStream;

public class BufferOutputStreamDemo {
    @SneakyThrows
    public static void main(String[] args) {
        BufferedOutputStream bufferedOutputStream = new BufferedOutputStream(new FileOutputStream("world.txt"));

        bufferedOutputStream.write("hello\r\n".getBytes());//hello
        bufferedOutputStream.write("world\r\n".getBytes());//world


        //释放资源
        bufferedOutputStream.close();
    }
}
